package com.whw.springboot.walk.service.servicelmpl;

import com.whw.springboot.walk.entity.Message;
import com.whw.springboot.walk.entity.UserInfo;
import com.whw.springboot.walk.mapper.UserInfoMapper;
import com.whw.springboot.walk.service.UserInfoService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class UserInfoServiceImpl implements UserInfoService{


    @Resource
    private UserInfoMapper userInfoMapper;


    @Override
    public Message<?> AddUserInfo(UserInfo userInfo) {
        return userInfoMapper.AddUserInfo(userInfo)> 0 ? Message.success(null) : Message.fail(null);
    }


    @Override
    public Message<?> deleteUserInfo(String userId) {
        return userInfoMapper.deleteUserInfo(userId)> 0 ?Message.success(null) : Message.fail(null);
    }


    @Override
    public Message<?> updateUserInfo(UserInfo userInfo) {
        return userInfoMapper.updateUserInfo(userInfo)> 0 ?Message.success(null) : Message.fail(null);
    }


    @Override
    public Message<?> updateUserInfoByPrimaryKeySelective(UserInfo userInfo) {
        return userInfoMapper.updateUserInfoByPrimaryKeySelective(userInfo)> 0 ?Message.success(null) : Message.fail(null);
    }


    @Override
    public Message<UserInfo> selectUserInfoByUserId(String userId) {
        return Message.success(null).add(userInfoMapper.selectUserInfoByUserId(userId));
    }


    @Override
    public Message<List<UserInfo>> selectAllUserInfo() {
        return Message.success(null).add(userInfoMapper.selectAllUserInfo());
    }


    @Override
    public Message<List<UserInfo>> selectUserInfoByOldStatues(String OldStatues) {
        return Message.success(null).add(userInfoMapper.selectUserInfoByOldStatues(OldStatues));
    }


    @Override
    public Message<List<UserInfo>> findUserInfoByLessonName(String lessonName) {
        return Message.success(null).add(userInfoMapper.findUserInfoByLessonName(lessonName));
    }

    @Override
    public Message<List<UserInfo>> findUserInfoByActId(String actId) {
        return Message.success(null).add(userInfoMapper.findUserInfoByActId(actId));
    }


}
